//
//  Device.m
//  PacketSniffer
//
//  Created by nark on 15/04/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "PSDevice.h"
#import "header.h"

@implementation PSDevice

@synthesize name;
@synthesize description;
@synthesize usable;

- (id) initWithName:(NSString *)_name
{
	self = [super init];
	if (self != nil) {
		name = _name;
		usable = [self test];
	}
	return self;
}

- (BOOL)test {
	BOOL result;
	
	
	return result;
}

- (void)setNet:(bpf_u_int32 )_net {
	net = _net;
}

- (void)setMask:(bpf_u_int32 )_mask {
	mask = _mask;
}

- (bpf_u_int32)net {
	return net;
}

- (bpf_u_int32)mask {
	return mask;
}

- (NSString *)netAsString {
	struct in_addr tmp;
	tmp.s_addr = net;
	return [NSString stringWithUTF8String:inet_ntoa(tmp)];
}

- (NSString *)maskAsString {
	struct in_addr tmp;
	tmp.s_addr = mask;
	return [NSString stringWithUTF8String:inet_ntoa(tmp)];
}

@end
